Quickly Build an Intelligent Sales Analysis Report
In the digital era, intelligent analysis of sales data has become a crucial tool for enterprise decision-making. This tutorial uses the sales data of the coffee category from a fast-moving consumer goods company as an example to guide you through quickly building a natural language-driven intelligent sales analysis report, realizing a fully automated process from data to insights.
You only need to enter a natural language query, such as "Analyze the coffee sales trends of each store in the last quarter," and the system will automatically recognize the business intent, optimize and generate SQL queries, extract the required information from the data source, and automatically generate chart reports. Whether it's comparing sales of different flavors, generating regional sales heatmaps, or analyzing the effectiveness of promotional activities, all can be accomplished with one click.
The generated reports support customizable styles, flexible chart type switching, and can enable AI insight features to help you automatically identify key factors behind sales fluctuations, and promptly discover growth opportunities or potential issues.
This tutorial is suitable for data analysis beginners, business managers, and enterprise users who want to quickly validate sales strategies. It is an ideal starting point for building practical and intelligent sales analysis reports.
Coffee Sales Data Preparation
Before building the report, you first need to prepare the coffee sales data. In this tutorial, we use the daily sales data of the coffee category from a fast-moving consumer goods company, which is stored in a SQL Server database and mainly includes two tables:
coffee_sales
coffee_sales_0613
Importing the sales data into the database is a prerequisite for the system to recognize and analyze the data. Besides SQL Server, you can also choose to store the data in other compatible data platforms, such as: MySQL
, Azure Databricks
After the data import is complete, you need to obtain the database connection information, including:
- Host (database address)
- Port (port number)
- Username
- Password
- Database name
This information will be used when adding the data source in subsequent steps.
Add Coffee Sales Data as a Data Source
Next, we need to add the coffee sales data tables in the database as a data source recognizable by the system. The steps are as follows:
- Enter the Data module in the system.
- Click "Data Sources" in the left menu bar.
- On the data source page, click the "Add Data Source" button in the upper right corner.
- On the "Create Data Source" page, fill in the following information:
- Data Source Name:
coffee
- Data Source Description:
sales data for coffee
- Database Type: select
SQL Server
- Host: enter the database address
- Port: enter the port number
- Username / Password: enter the required authentication information
- Database Name: enter the name of the database where the sales data is stored
- Data Source Name:
- Click "Test Connection" below to verify if the information is correct.
- After the test passes, click "Confirm" to complete the data source addition.
At this point, the system has successfully established a connection with the database.
Select Coffee Sales Data Tables
After creating the data source, you also need to specify the actual data tables to be used:
- Return to the data source list and click the newly created
coffee
data source. - On the data source details page, select the following two tables as analysis targets:
coffee_sales
coffee_sales_0613
- Select and confirm to add them. This step ensures that the system has correctly read and loaded the coffee sales data.
At this point, the coffee sales data has been officially connected to the system as a data source, ready to enter the next step of intelligent analysis construction.
Synchronize Coffee Sales Data to the Data Catalog
Although we have successfully added the coffee sales data tables as data sources, the system still cannot view the field structure of these two tables, nor does it have any business semantic descriptions of the fields. Therefore, the next step is to synchronize the table structure in the data catalog and supplement the field information to improve the readability and accuracy of subsequent data analysis.
Synchronization Steps
- Enter the system's Data module.
- Click "Data Catalog" in the left menu bar.
- Under "Belonging Data Source" on the page, find the data source
coffee
you just added. - The system will display the two data tables under this data source on the right:
coffee_sales
coffee_sales_0613
- Click to enter the second table
coffee_sales
.
- On the table details page, click the "Synchronize" button in the upper right corner:
- The system will automatically pull and display the field structure of the table from the database, including field names and types.
- After synchronization is complete, click "Intelligent Data Knowledge Supplement" in the upper right corner:
- The system will intelligently supplement business aliases, field descriptions, and other information based on the field names.
- If the generated results do not match the actual business, you can manually modify the field descriptions to ensure accuracy.
- Perform the same operations to synchronize and supplement field descriptions for the second table
coffee_sales_0613
.
Through structure synchronization and field supplementation in the data catalog, the system can correctly recognize the meaning of fields, thereby providing more accurate support for subsequent report generation and insights.
Create a Business Domain for Coffee Sales Data
To better organize and manage sales data, and to improve reusability and maintainability when building intelligent analysis reports later, we need to create an independent business domain for the coffee sales data.
Steps to Create a Business Domain:
- In the system's Data module, click "Business Domain" in the left menu bar.
- Click the "+ Business Domain" button in the upper right corner to enter the business domain creation page.
- Fill in the following information:
- Business Domain Name:
coffee sales
- Select Data Source: select the newly created data source
coffee
from the dropdown - Business Domain Description:
The coffee sales data domain covers the entire process of managing data from coffee product sales records, customer purchasing behavior to sales channels. Analyzing this data helps optimize inventory, improve sales strategies, and enhance customer satisfaction.
- Prompt Information:
Please ensure the completeness and accuracy of sales data to support effective business analysis and decision-making.
- Business Domain Name:
- After filling in the information, click "Confirm" to complete the creation of the business domain.
Configure Business Domain Table Relationships
After the business domain is successfully created, the system will automatically enter the business domain configuration page. At this point, you need to add the actual coffee sales data tables to the business domain panel and configure their logical relationships.
Add Data Tables to the Business Domain Panel:
- In the business domain configuration interface, select and check the two tables:
coffee_sales
coffee_sales_0613
- After checking, the two tables will appear in the business domain panel.
Create Relationships Between Tables:
- In the panel, find the
coffee_sales_0613
table and locate the "Relationship List" below the table. - Click the "+" button to create a new relationship.
- In the pop-up relationship settings dialog, fill in the following:
- From Table Field:
coffee_sales_0613.id
- To Table Field:
coffee_sales.id
- Relation Type: select "One-to-One"
- From Table Field:
- Click "Confirm" to complete the relationship creation.
- After creation, a one-to-one relationship line connecting the two tables will be displayed in the panel.
Save Business Domain Relationship Configuration:
Click the "Save" button in the upper right corner, and the system will store the currently configured table structure and relationship settings.
At this point, the business domain configuration is complete, laying a solid foundation for subsequent intelligent report building. The system will be able to more accurately parse data fields and understand data semantics, thereby supporting natural language analysis and chart generation.
Create an Intelligent Sales Analysis Report
After completing data integration, data catalog configuration, and business domain construction, we are fully prepared to build an intelligent BI report. Next, we will officially start creating the sales analysis report.
Enter the Intelligent BI Analysis Module
- Enter the Data module in the system.
- Click "Data Agents" in the left menu bar.
- In Data Agents, click "Intelligent BI"
- The system will jump to the Intelligent BI report creation interface.
Select Business Domain
- Click "Select Business Domain" on the left side of the page.
- In the pop-up business domain list, select the previously created business domain
coffee sales
. - After successful selection, the page will automatically load the two tables under this business domain:
coffee_sales
coffee_sales_0613
These data tables will serve as the basis for subsequent analysis.
Generate Charts Using Natural Language Queries
Intelligent BI supports natural language analysis, greatly lowering the threshold for data analysis. Here is a practical example:
- Enter in the natural language input box at the top of the page:
统计不同咖啡类型的销售总量
- After receiving the request, the system will automatically recognize the analysis intent and generate the corresponding SQL query.
- After the query is executed, the system will automatically generate a visual chart.
By default, the system usually displays the data as a line chart. However, in this case, we are more interested in comparing total sales, so a bar chart is more suitable.
Adjust Chart Style
To improve the readability and visual effect of the report, we can optimize the chart style:
- Click the "Edit Style" button in the upper right corner of the chart.
- The Style Editing Bar will pop up on the right side of the page, where you can customize the chart's display.
The following are the style settings used in this example:
- Chart Title: change to
Sales Total (Coffee Type)
- Chart Type: select
Bar Chart
- X Axis Field:
coffee_type
(Coffee Type) - Y Axis Field:
total_sales
(Total Sales) - Theme Style: can be selected according to business scenarios and personal preferences. Here, it is recommended to choose the blue style to highlight a clear and professional visual impression.
The system supports real-time preview of chart styles, allowing you to view changes as you adjust, avoiding the inconvenience of repeated modifications.
After completing the above settings, an intuitive, clear, and data-driven coffee sales analysis chart is built, providing a solid foundation for subsequent insights.
Enable Intelligent Data Insights
After building the sales report, we can further utilize the system's intelligent insight feature to mine potential trends and business opportunities from the data, assisting in deeper analysis and decision-making.
Quickly Generate Automatic Insights
- Click the "Insights" button in the upper right corner of the report page.
- The system will automatically perform intelligent analysis based on the current chart's dimensions and metrics, and output a set of data insight results.
These automatically generated insights include but are not limited to:
- Trend Analysis: Identify sales trends, such as a significant increase or decrease in sales of a certain coffee type during a specific period.
- Correlation Analysis: Determine the correlation between different fields, such as whether there is a sales relationship between a certain type of coffee and store location.
- Difference Analysis: Identify significant differences between categories, such as differences in sales performance of different coffee types across regions.
- Data Summary: The system automatically extracts key conclusions based on the chart content, making it easy to quickly understand the business meaning behind the data.
Custom Natural Language Insights
In addition to automatic insights, you can also enter more specific analysis requirements in natural language for in-depth insights.
- Enter in the input box below:
各咖啡类型在总销售中的占比变化
- The system will generate new data queries and analysis logic based on this question and return insights on this topic.
This approach is especially suitable for business personnel to explore data through "question-based" exploration and quickly obtain valuable information. By combining automatic and custom insights, the insight feature not only expands the usability of charts but also further enhances the intelligence and business value of data analysis.
At this point, a complete sales analysis process from data integration → report creation → intelligent insights has been built, providing business teams with an intuitive, efficient, and intelligent data analysis tool.
Publish Intelligent BI Reports
After completing the report creation, you can publish the report for later viewing or sharing.
The system supports two publishing locations:
- My Reports: Visible only to yourself, suitable for personal viewing and saving.
- Report Center: Visible to team members, suitable for sharing and collaboration.